package com.ruoyi.project.domain.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.base.Field;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;

@Data
@TableName("project_warranty")
public class ProjectWarranty extends Field {

    private static final long serialVersionUID = 1L;

    /** 表id */
    @TableField(fill = FieldFill.INSERT)
    @ApiModelProperty("id")
    @TableId
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;

    /** 从立项前期的付款公司带出 */
    @Excel(name = "从立项前期的付款公司带出")
    private String company;

    @Excel(name = "从立项前期的付款公司带出")
    private String companyId;


    //状态 1表示未完成 2表示已完成
    private String status;

    /** 结算金额 */
    @Excel(name = "结算金额")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "#0.00")
    private BigDecimal settlementAmount;

    //质保金
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "#0.00")
    private BigDecimal warranty;

    /** 质保金比例 */
    @Excel(name = "质保金比例")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "#0.00")
    private BigDecimal warrantyPercentage;

    /** 税率 */
    @Excel(name = "税率")
    private BigDecimal rate;

    /** 周期 多少个月 */
    @Excel(name = "周期 多少个月")
    private Double cycle;

    /** 起始日期 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "起始日期", width = 30, dateFormat = "yyyy-MM-dd")
    private Date startDate;

    /** 截止日期 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "截止日期", width = 30, dateFormat = "yyyy-MM-dd")
    private Date endDate;

    //质保到期剩余多少天
    private Integer  warrantyRemaining;

    /** 质保金实收金额 */
    @Excel(name = "质保金实收金额")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "#0.00")
    private BigDecimal receivedAmount;

    /** 附件 */
    @Excel(name = "附件")
    private String files;


    /** 文件名称 */
    @Excel(name = "文件名称")
    private String fileName;

    //操作人
    private String operator;

    //项目id
    private String projectNo;

    //备注
    private String remark;

    //关联的阶段
    private Long phaseId;

    //关联的阶段
    private String phaseName;

    //行状态
    @TableField(exist = false)
    private String rowStatus;

    //逾期未收的金额
    @TableField(exist = false)
    private BigDecimal overdueAmount;

    //项目总数
    @TableField(exist = false)
    private Integer projectCount;

    //逾期未收的数量
    @TableField(exist = false)
    private Integer overdueCount;


    //项目名称
    @TableField(exist = false)
    private String projectName;


    @TableField(exist = false)
    private String createUser;

    /** 管家婆项目 */
    @Excel(name = "管家婆项目")
    @TableField(exist = false)
    private String housekeeperName;




}
